﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:SilverlightTextEditor"
    xmlns:l="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
    xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls" 
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" 
    xmlns:dataPrimitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Data"         
    mc:Ignorable="d" 
    x:Class="SilverlightTextEditor.PageTitle"
    d:DesignHeight="100" d:DesignWidth="450" FontFamily="Calibri" Loaded="UserControl_Loaded">
    <UserControl.Resources>        
        <local:Strings x:Key="localizedStrings"/>
		<Style x:Key="MenuLabel" TargetType="TextBlock">			
			<Setter Property="FontSize" Value="18" />
			<Setter Property="Foreground" Value="#FF1D50A3" />
			<Setter Property="HorizontalAlignment" Value="Center" />	
			<Setter Property="VerticalAlignment" Value="Bottom" />	
			<Setter Property="Margin" Value="0,0,0,1" />	
		</Style>
    	<Style x:Key="RichTextBoxStyle1" TargetType="RichTextBox">
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="Background" Value="#FFFFFFFF"/>
    		<Setter Property="Foreground" Value="#FF000000"/>
    		<Setter Property="Padding" Value="2"/>
    		<Setter Property="BorderBrush">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFA3AEB9" Offset="0"/>
    					<GradientStop Color="#FF8399A9" Offset="0.375"/>
    					<GradientStop Color="#FF718597" Offset="0.375"/>
    					<GradientStop Color="#FF617584" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="RichTextBox">
    					<Grid x:Name="RootElement">
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="MouseOver"/>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="ReadOnly">
    									<Storyboard>
    										<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ReadOnlyVisualElement">
    											<SplineDoubleKeyFrame KeyTime="0" Value="1"/>
    										</DoubleAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="FocusStates">
    								<VisualState x:Name="Focused"/>
    								<VisualState x:Name="Unfocused"/>
    							</VisualStateGroup>
    							<VisualStateGroup x:Name="ValidationStates">
    								<VisualState x:Name="Valid"/>
    								<VisualState x:Name="InvalidUnfocused">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    								<VisualState x:Name="InvalidFocused">
    									<Storyboard>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<Visibility>Visible</Visibility>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    										<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
    											<DiscreteObjectKeyFrame KeyTime="0">
    												<DiscreteObjectKeyFrame.Value>
    													<System:Boolean>True</System:Boolean>
    												</DiscreteObjectKeyFrame.Value>
    											</DiscreteObjectKeyFrame>
    										</ObjectAnimationUsingKeyFrames>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="1" Opacity="1">
    							<Grid>
    								<Border x:Name="ReadOnlyVisualElement" Background="#72F7F7F7" Opacity="0"/>
    								<Border x:Name="MouseOverBorder" BorderBrush="Transparent" BorderThickness="1">
    									<ScrollViewer x:Name="ContentElement" BorderThickness="0" IsTabStop="False" Padding="{TemplateBinding Padding}"/>
    								</Border>
    							</Grid>
    						</Border>
    						<Border x:Name="DisabledVisualElement" BorderBrush="#A5F7F7F7" BorderThickness="{TemplateBinding BorderThickness}" Background="#A5F7F7F7" IsHitTestVisible="False" Opacity="0"/>
    						<Border x:Name="FocusVisualElement" BorderBrush="#FFB8B8B8" BorderThickness="{TemplateBinding BorderThickness}" IsHitTestVisible="False" Margin="1" Opacity="0"/>
    						<Border x:Name="ValidationErrorElement" BorderBrush="#FFDB000C" BorderThickness="1" CornerRadius="1" Visibility="Collapsed">
    							<ToolTipService.ToolTip>
    								<ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}">
    									<ToolTip.Triggers>
    										<EventTrigger RoutedEvent="Canvas.Loaded">
    											<BeginStoryboard>
    												<Storyboard>
    													<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsHitTestVisible" Storyboard.TargetName="validationTooltip">
    														<DiscreteObjectKeyFrame KeyTime="0">
    															<DiscreteObjectKeyFrame.Value>
    																<System:Boolean>true</System:Boolean>
    															</DiscreteObjectKeyFrame.Value>
    														</DiscreteObjectKeyFrame>
    													</ObjectAnimationUsingKeyFrames>
    												</Storyboard>
    											</BeginStoryboard>
    										</EventTrigger>
    									</ToolTip.Triggers>
    								</ToolTip>
    							</ToolTipService.ToolTip>
    							<Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
    								<Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="#FFDC000C" Margin="1,3,0,0"/>
    								<Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#ffffff" Margin="1,3,0,0"/>
    							</Grid>
    						</Border>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>    	
    	<LinearGradientBrush x:Key="MenuDividerBrush" EndPoint="0.5,1" StartPoint="0.5,0">
    		<GradientStop Color="#FFC0D8F0" Offset="1"/>
    		<GradientStop Color="#FFDBE6F3" Offset="0"/>
    		<GradientStop Color="#FFC1D9F1" Offset="0.685"/>
    		<GradientStop Color="#FFD7E7F5" Offset="0.678"/>
    		<GradientStop Color="#FFDAE6F3" Offset="0.133"/>
    		<GradientStop Color="#FFC7D8ED" Offset="0.174"/>
    		<GradientStop Color="#FFC8D9ED" Offset="0.478"/>
    	</LinearGradientBrush>
    	<Style x:Key="DataGridStyle1" TargetType="data:DataGrid">
    		<Setter Property="RowBackground" Value="#AAEAEFF4"/>
    		<Setter Property="AlternatingRowBackground" Value="#00FFFFFF"/>
    		<Setter Property="Background" Value="#FFFFFFFF"/>
    		<Setter Property="HeadersVisibility" Value="Column"/>
    		<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
    		<Setter Property="VerticalScrollBarVisibility" Value="Auto"/>
    		<Setter Property="SelectionMode" Value="Extended"/>
    		<Setter Property="CanUserReorderColumns" Value="True"/>
    		<Setter Property="CanUserResizeColumns" Value="True"/>
    		<Setter Property="CanUserSortColumns" Value="True"/>
    		<Setter Property="AutoGenerateColumns" Value="True"/>
    		<Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
    		<Setter Property="BorderBrush">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFA3AEB9" Offset="0"/>
    					<GradientStop Color="#FF8399A9" Offset="0.375"/>
    					<GradientStop Color="#FF718597" Offset="0.375"/>
    					<GradientStop Color="#FF617584" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="DragIndicatorStyle">
    			<Setter.Value>
    				<Style TargetType="ContentControl">
    					<Setter Property="Foreground" Value="#7FFFFFFF"/>
    					<Setter Property="Template">
    						<Setter.Value>
    							<ControlTemplate TargetType="ContentControl">
    								<Grid>
    									<VisualStateManager.VisualStateGroups>
    										<VisualStateGroup x:Name="SortStates">
    											<VisualState x:Name="Unsorted"/>
    											<VisualState x:Name="SortAscending">
    												<Storyboard>
    													<DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
    												</Storyboard>
    											</VisualState>
    											<VisualState x:Name="SortDescending">
    												<Storyboard>
    													<DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon"/>
    													<DoubleAnimation Duration="0" To="-.9" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon"/>
    												</Storyboard>
    											</VisualState>
    										</VisualStateGroup>
    									</VisualStateManager.VisualStateGroups>
    									<Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Fill="#66808080" Stretch="Fill"/>
    									<Rectangle x:Name="BackgroundGradient" Grid.ColumnSpan="2" Opacity="0" Stretch="Fill">
    										<Rectangle.Fill>
    											<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    												<GradientStop Color="#FFFFFFFF" Offset="0.015"/>
    												<GradientStop Color="#F9FFFFFF" Offset="0.375"/>
    												<GradientStop Color="#E5FFFFFF" Offset="0.6"/>
    												<GradientStop Color="#C6FFFFFF" Offset="1"/>
    											</LinearGradientBrush>
    										</Rectangle.Fill>
    									</Rectangle>
    									<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
    										<Grid.ColumnDefinitions>
    											<ColumnDefinition/>
    											<ColumnDefinition Width="Auto"/>
    										</Grid.ColumnDefinitions>
    										<ContentPresenter Content="{TemplateBinding Content}"/>
    										<Path x:Name="SortIcon" Grid.Column="1" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " Fill="#7FFFFFFF" HorizontalAlignment="Left" Margin="4,0,0,0" Opacity="0" RenderTransformOrigin=".5,.5" Stretch="Uniform" VerticalAlignment="Center" Width="8">
    											<Path.RenderTransform>
    												<ScaleTransform ScaleY=".9" ScaleX=".9"/>
    											</Path.RenderTransform>
    										</Path>
    									</Grid>
    								</Grid>
    							</ControlTemplate>
    						</Setter.Value>
    					</Setter>
    				</Style>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="DropLocationIndicatorStyle">
    			<Setter.Value>
    				<Style TargetType="ContentControl">
    					<Setter Property="Background" Value="#FF3F4346"/>
    					<Setter Property="Width" Value="2"/>
    					<Setter Property="Template">
    						<Setter.Value>
    							<ControlTemplate TargetType="ContentControl">
    								<Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
    							</ControlTemplate>
    						</Setter.Value>
    					</Setter>
    				</Style>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="GridLinesVisibility" Value="Vertical"/>
    		<Setter Property="HorizontalGridLinesBrush" Value="#FFC9CACA"/>
    		<Setter Property="IsTabStop" Value="True"/>
    		<Setter Property="VerticalGridLinesBrush" Value="#FFC9CACA"/>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="data:DataGrid">
    					<Grid>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement" From="0"/>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
    							<Grid x:Name="Root" Background="{TemplateBinding Background}">
    								<Grid.Resources>
    									<ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="dataPrimitives:DataGridColumnHeader">
    										<Grid x:Name="Root">
    											<Grid.RowDefinitions>
    												<RowDefinition/>
    												<RowDefinition/>
    												<RowDefinition Height="Auto"/>
    											</Grid.RowDefinitions>
    											<Border BorderBrush="#FFC9CACA" BorderThickness="0,0,1,0" Background="#FF1F3B53" Grid.RowSpan="2">
    												<Rectangle Stretch="Fill" StrokeThickness="1">
    													<Rectangle.Fill>
    														<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    															<GradientStop Color="#FCFFFFFF" Offset="0.015"/>
    															<GradientStop Color="#F7FFFFFF" Offset="0.375"/>
    															<GradientStop Color="#E5FFFFFF" Offset="0.6"/>
    															<GradientStop Color="#D1FFFFFF" Offset="1"/>
    														</LinearGradientBrush>
    													</Rectangle.Fill>
    												</Rectangle>
    											</Border>
    											<Rectangle Fill="#FFDBDCDC" Height="1" Grid.RowSpan="2" StrokeThickness="1" VerticalAlignment="Bottom" Width="Auto"/>
    										</Grid>
    									</ControlTemplate>
    									<ControlTemplate x:Key="TopRightHeaderTemplate" TargetType="dataPrimitives:DataGridColumnHeader">
    										<Grid x:Name="RootElement">
    											<Grid.RowDefinitions>
    												<RowDefinition/>
    												<RowDefinition/>
    												<RowDefinition Height="Auto"/>
    											</Grid.RowDefinitions>
    											<Border BorderBrush="#FFC9CACA" BorderThickness="1,0,0,0" Background="#FF1F3B53" Grid.RowSpan="2">
    												<Rectangle Stretch="Fill">
    													<Rectangle.Fill>
    														<LinearGradientBrush EndPoint=".7,1" StartPoint=".7,0">
    															<GradientStop Color="#FCFFFFFF" Offset="0.015"/>
    															<GradientStop Color="#F7FFFFFF" Offset="0.375"/>
    															<GradientStop Color="#E5FFFFFF" Offset="0.6"/>
    															<GradientStop Color="#D1FFFFFF" Offset="1"/>
    														</LinearGradientBrush>
    													</Rectangle.Fill>
    												</Rectangle>
    											</Border>
    										</Grid>
    									</ControlTemplate>
    								</Grid.Resources>
    								<Grid.ColumnDefinitions>
    									<ColumnDefinition Width="Auto"/>
    									<ColumnDefinition/>
    									<ColumnDefinition Width="Auto"/>
    								</Grid.ColumnDefinitions>
    								<Grid.RowDefinitions>
    									<RowDefinition Height="Auto"/>
    									<RowDefinition/>
    									<RowDefinition Height="Auto"/>
    									<RowDefinition Height="Auto"/>
    								</Grid.RowDefinitions>
    								<dataPrimitives:DataGridColumnHeader x:Name="TopLeftCornerHeader" Template="{StaticResource TopLeftHeaderTemplate}" Width="22"/>
    								<dataPrimitives:DataGridColumnHeadersPresenter x:Name="ColumnHeadersPresenter" Grid.Column="1"/>
    								<dataPrimitives:DataGridColumnHeader x:Name="TopRightCornerHeader" Grid.Column="2" Template="{StaticResource TopRightHeaderTemplate}"/>
    								<Rectangle x:Name="ColumnHeadersAndRowsSeparator" Grid.ColumnSpan="3" Fill="#FFC9CACA" Height="1" StrokeThickness="1" VerticalAlignment="Bottom" Width="Auto"/>
    								<dataPrimitives:DataGridRowsPresenter x:Name="RowsPresenter" Grid.ColumnSpan="2" Grid.Row="1"/>
    								<Rectangle x:Name="BottomRightCorner" Grid.Column="2" Fill="#FFE9EEF4" Grid.Row="2"/>
    								<Rectangle x:Name="BottomLeftCorner" Grid.ColumnSpan="2" Fill="#FFE9EEF4" Grid.Row="2"/>
    								<ScrollBar x:Name="VerticalScrollbar" Grid.Column="2" Margin="0,-1,-1,-1" Orientation="Vertical" Grid.Row="1" Width="18"/>
    								<Grid Grid.Column="1" Grid.Row="2">
    									<Grid.ColumnDefinitions>
    										<ColumnDefinition Width="Auto"/>
    										<ColumnDefinition/>
    									</Grid.ColumnDefinitions>
    									<Rectangle x:Name="FrozenColumnScrollBarSpacer"/>
    									<ScrollBar x:Name="HorizontalScrollbar" Grid.Column="1" Height="18" Margin="-1,0,-1,-1" Orientation="Horizontal"/>
    								</Grid>
    								<l:ValidationSummary x:Name="ValidationSummary" Grid.ColumnSpan="3" Filter="ObjectErrors" MaxHeight="90" Grid.Row="3"/>
    							</Grid>
    						</Border>
    						<Border x:Name="DisabledVisualElement" Background="#8CFFFFFF" CornerRadius="2" HorizontalAlignment="Stretch" Height="Auto" IsHitTestVisible="False" Opacity="0" VerticalAlignment="Stretch" Width="Auto"/>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="CalendarItemStyle1" TargetType="System_Windows_Controls_Primitives:CalendarItem">
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="System_Windows_Controls_Primitives:CalendarItem">
    					<Grid>
    						<Grid.Resources>
    							<SolidColorBrush x:Key="DisabledBrush" Color="#8CFFFFFF"/>
    						</Grid.Resources>
    						<VisualStateManager.VisualStateGroups>
    							<VisualStateGroup x:Name="CommonStates">
    								<VisualState x:Name="Normal"/>
    								<VisualState x:Name="Disabled">
    									<Storyboard>
    										<DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual"/>
    									</Storyboard>
    								</VisualState>
    							</VisualStateGroup>
    						</VisualStateManager.VisualStateGroups>
    						<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="1" Margin="0,2,0,2">
    							<Border BorderBrush="#FFFFFFFF" BorderThickness="2" CornerRadius="1">
    								<Grid>
    									<Grid.Resources>
    										<ControlTemplate x:Key="HeaderButtonTemplate" TargetType="Button">
    											<Grid Cursor="Hand">
    												<VisualStateManager.VisualStateGroups>
    													<VisualStateGroup x:Name="CommonStates">
    														<VisualState x:Name="Normal"/>
    														<VisualState x:Name="MouseOver">
    															<Storyboard>
    																<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content"/>
    															</Storyboard>
    														</VisualState>
    														<VisualState x:Name="Disabled">
    															<Storyboard>
    																<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content"/>
    															</Storyboard>
    														</VisualState>
    													</VisualStateGroup>
    												</VisualStateManager.VisualStateGroups>
    												<ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="#FF333333" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="1,5,1,9" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
    											</Grid>
    										</ControlTemplate>
    										<DataTemplate x:Name="DayTitleTemplate">
    											<TextBlock FontWeight="Bold" FontSize="9.5" HorizontalAlignment="Center" Margin="0,4,0,4" Text="{Binding}" VerticalAlignment="Center"/>
    										</DataTemplate>
    										<ControlTemplate x:Key="PreviousButtonTemplate" TargetType="Button">
    											<Grid Cursor="Hand">
    												<VisualStateManager.VisualStateGroups>
    													<VisualStateGroup x:Name="CommonStates">
    														<VisualState x:Name="Normal"/>
    														<VisualState x:Name="MouseOver">
    															<Storyboard>
    																<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="IconPath"/>
    															</Storyboard>
    														</VisualState>
    														<VisualState x:Name="Disabled">
    															<Storyboard>
    																<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)" Storyboard.TargetName="IconPath"/>
    															</Storyboard>
    														</VisualState>
    													</VisualStateGroup>
    												</VisualStateManager.VisualStateGroups>
    												<Rectangle Fill="#11E5EBF1" Opacity="1" Stretch="Fill"/>
    												<Grid>
    													<Path x:Name="IconPath" Data="M288.75,232.25 L288.75,240.625 L283,236.625 z" Fill="#FF333333" HorizontalAlignment="Left" Height="10" Margin="14,-6,0,0" Stretch="Fill" VerticalAlignment="Center" Width="6"/>
    												</Grid>
    											</Grid>
    										</ControlTemplate>
    										<ControlTemplate x:Key="NextButtonTemplate" TargetType="Button">
    											<Grid Cursor="Hand">
    												<VisualStateManager.VisualStateGroups>
    													<VisualStateGroup x:Name="CommonStates">
    														<VisualState x:Name="Normal"/>
    														<VisualState x:Name="MouseOver">
    															<Storyboard>
    																<ColorAnimation Duration="0" To="#FF73A9D8" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="IconPath"/>
    															</Storyboard>
    														</VisualState>
    														<VisualState x:Name="Disabled">
    															<Storyboard>
    																<DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Opacity)" Storyboard.TargetName="IconPath"/>
    															</Storyboard>
    														</VisualState>
    													</VisualStateGroup>
    												</VisualStateManager.VisualStateGroups>
    												<Rectangle Fill="#11E5EBF1" Opacity="1" Stretch="Fill"/>
    												<Grid>
    													<Path x:Name="IconPath" Data="M282.875,231.875 L282.875,240.375 L288.625,236 z" Fill="#FF333333" HorizontalAlignment="Right" Height="10" Margin="0,-6,14,0" Stretch="Fill" VerticalAlignment="Center" Width="6"/>
    												</Grid>
    											</Grid>
    										</ControlTemplate>
    									</Grid.Resources>
    									<Grid.ColumnDefinitions>
    										<ColumnDefinition Width="Auto"/>
    										<ColumnDefinition Width="Auto"/>
    										<ColumnDefinition Width="Auto"/>
    									</Grid.ColumnDefinitions>
    									<Grid.RowDefinitions>
    										<RowDefinition Height="Auto"/>
    										<RowDefinition Height="*"/>
    									</Grid.RowDefinitions>
    									<Button x:Name="PreviousButton" HorizontalAlignment="Left" Height="20" Template="{StaticResource PreviousButtonTemplate}" Visibility="Collapsed" Width="28"/>
    									<Button x:Name="HeaderButton" Grid.Column="1" FontWeight="Bold" FontSize="10.5" HorizontalAlignment="Center" Template="{StaticResource HeaderButtonTemplate}" VerticalAlignment="Center"/>
    									<Button x:Name="NextButton" Grid.Column="2" HorizontalAlignment="Right" Height="20" Template="{StaticResource NextButtonTemplate}" Visibility="Collapsed" Width="28"/>
    									<Grid x:Name="MonthView" Grid.ColumnSpan="3" Margin="6,-1,6,6" Grid.Row="1" Visibility="Collapsed">
    										<Grid.ColumnDefinitions>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    										</Grid.ColumnDefinitions>
    										<Grid.RowDefinitions>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    										</Grid.RowDefinitions>
    									</Grid>
    									<Grid x:Name="YearView" Grid.ColumnSpan="3" Margin="6,-3,7,6" Grid.Row="1" Visibility="Collapsed">
    										<Grid.ColumnDefinitions>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    											<ColumnDefinition Width="Auto"/>
    										</Grid.ColumnDefinitions>
    										<Grid.RowDefinitions>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    											<RowDefinition Height="Auto"/>
    										</Grid.RowDefinitions>
    									</Grid>
    								</Grid>
    							</Border>
    						</Border>
    						<Rectangle x:Name="DisabledVisual" Fill="{StaticResource DisabledBrush}" Margin="0,2,0,2" Opacity="0" RadiusY="2" RadiusX="2" Stretch="Fill" Stroke="{StaticResource DisabledBrush}" StrokeThickness="1" Visibility="Collapsed"/>
    					</Grid>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    	<Style x:Key="CalendarStyle1" TargetType="controls:Calendar">
    		<Setter Property="IsTabStop" Value="False"/>
    		<Setter Property="Background">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFD3DEE8" Offset="0"/>
    					<GradientStop Color="#FFD3DEE8" Offset="0.16"/>
    					<GradientStop Color="#FFFCFCFD" Offset="0.16"/>
    					<GradientStop Color="#FFFFFFFF" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="BorderThickness" Value="1"/>
    		<Setter Property="BorderBrush">
    			<Setter.Value>
    				<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
    					<GradientStop Color="#FFA3AEB9" Offset="0"/>
    					<GradientStop Color="#FF8399A9" Offset="0.375"/>
    					<GradientStop Color="#FF718597" Offset="0.375"/>
    					<GradientStop Color="#FF617584" Offset="1"/>
    				</LinearGradientBrush>
    			</Setter.Value>
    		</Setter>
    		<Setter Property="Template">
    			<Setter.Value>
    				<ControlTemplate TargetType="controls:Calendar">
    					<StackPanel x:Name="Root" HorizontalAlignment="Center">
    						<System_Windows_Controls_Primitives:CalendarItem x:Name="CalendarItem" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Style="{StaticResource CalendarItemStyle1}"/>
    					</StackPanel>
    				</ControlTemplate>
    			</Setter.Value>
    		</Setter>
    	</Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot"   Width="450">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="DragStates">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:0.3">
    					<VisualTransition.GeneratedEasingFunction>
    						<CircleEase EasingMode="EaseIn"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Normal"/>
    			<VisualState x:Name="DragOver">
    				<Storyboard>
    					<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)" Storyboard.TargetName="rtb">
    						<EasingColorKeyFrame KeyTime="0" Value="#FFFFF7D1"/>
    					</ColorAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Border x:Name="ApplicationBorder" MaxWidth="900" Margin="0,5,0,5" Grid.RowSpan="1" BorderThickness="1" BorderBrush="#FF646464">
    		<Grid x:Name="MainGrid">
    			<Grid.RowDefinitions>
    				<RowDefinition Height="35" />
    				<RowDefinition/>
    			</Grid.RowDefinitions>

                
                <Grid x:Name="ToolBarGrid" Margin="3,3,3,2" Background="AliceBlue" >
    				<Grid.RowDefinitions>
    					<RowDefinition Height="35"/>    					
    				</Grid.RowDefinitions>
                    
                    
                    <StackPanel Grid.Column="0" Height="22" Margin="6,5,0,0" Orientation="Horizontal" VerticalAlignment="Top">
                        <!--Buttons-->
                        <Button x:Name="btnBold" Click="btnBold_Click" Margin="0,0,1,0">
                            <ToolTipService.ToolTip>
                                <ToolTip FontSize="16" Content="{Binding tooltip_Bold, Source={StaticResource localizedStrings}}"/>
                            </ToolTipService.ToolTip>
                            <Image Source="Images/Bold.png" d:IsLocked="True"/>
                        </Button>

                        <Button x:Name="btnItalic" Click="btnItalic_Click" Margin="0,0,1,0">
                            <ToolTipService.ToolTip>
                                <ToolTip FontSize="16" Content="{Binding tooltip_Italic, Source={StaticResource localizedStrings}}"/>
                            </ToolTipService.ToolTip>
                            <Image Source="Images/Italic.png"/>
                        </Button>

                        <Button x:Name="btnUnderline" Click="btnUnderline_Click" Margin="0,0,13,0">
                            <ToolTipService.ToolTip>
                                <ToolTip FontSize="16" Content="Underline"/>
                            </ToolTipService.ToolTip>
                            <Image Source="Images/Underline.png"/>
                        </Button>
                       
                        <ComboBox x:Name="cmbFonts" FontFamily="{Binding SelectedItem.FontFamily, RelativeSource={RelativeSource Self}}" FontSize="{Binding SelectedItem.FontSize, RelativeSource={RelativeSource Self}}" SelectionChanged="cmbFonts_SelectionChanged" Margin="6,0,25,0" Height="22" VerticalAlignment="Bottom" >
                            <ComboBoxItem Content="Arial" Tag="Arial" FontFamily="Arial" FontSize="12"/>
                            <ComboBoxItem Content="Arial Black" Tag="Arial Black" FontFamily="Arial Black" FontSize="12"/>
                            <ComboBoxItem Content="Calibri" Tag="Calibri" FontFamily="Calibri" IsSelected="True" FontSize="14"/>
                            <ComboBoxItem Content="Comic Sans MS" Tag="Comic Sans MS" FontFamily="Comic Sans MS" FontSize="12"/>
                            <ComboBoxItem Content="Courier New" Tag="Courier New" FontFamily="Courier New" FontSize="12"/>
                            <ComboBoxItem Content="Georgia" Tag="Georgia" FontFamily="Georgia" FontSize="12"/>
                            <ComboBoxItem Content="Lucida Sans Unicode" Tag="Lucida Sans Unicode" FontFamily="Lucida Sans Unicode" FontSize="12"/>
                            <ComboBoxItem Content="Portable User Interface" Tag="{x:Null}" FontFamily="Portable User Interface" FontSize="12"/>
                            <ComboBoxItem Content="Times New Roman" Tag="Times New Roman" FontFamily="Times New Roman" FontSize="12"/>
                            <ComboBoxItem Content="Trebuchet MS" Tag="Trebuchet MS" FontFamily="Trebuchet MS" FontSize="12"/>
                            <ComboBoxItem Content="Verdana" Tag="Verdana" FontFamily="Verdana" FontSize="12"/>
                            <ComboBoxItem Content="Webdings" Tag="Webdings" FontSize="12"/>
                        </ComboBox>

                        <ComboBox x:Name="cmbFontSizes"   Width="44" FontSize="14" SelectionChanged="cmbFontSizes_SelectionChanged" HorizontalAlignment="Right" Margin="0,0,6,0" Height="22" VerticalAlignment="Bottom">
                            <ComboBoxItem Content="8" Tag="8"/>
                            <ComboBoxItem Content="9" Tag="9"/>
                            <ComboBoxItem Content="10" Tag="10"/>
                            <ComboBoxItem Content="11" Tag="11"/>
                            <ComboBoxItem Content="12" Tag="12"/>
                            <ComboBoxItem Content="14" Tag="14"/>
                            <ComboBoxItem Content="16" Tag="16" IsSelected="True"/>
                            <ComboBoxItem Content="18" Tag="18"/>
                            <ComboBoxItem Content="20" Tag="20"/>
                            <ComboBoxItem Content="22" Tag="22"/>
                            <ComboBoxItem Content="24" Tag="24"/>
                            <ComboBoxItem Content="26" Tag="26"/>
                            <ComboBoxItem Content="28" Tag="28"/>
                            <ComboBoxItem Content="36" Tag="36"/>
                            <ComboBoxItem Content="48" Tag="48"/>
                            <ComboBoxItem Content="72" Tag="72"/>
                        </ComboBox>

                        <ComboBox x:Name="cmbFontColors" SelectionChanged="cmbFontColors_SelectionChanged" SelectedIndex="0" Margin="5,0,0,0" HorizontalAlignment="Right" Width="46">
                            <ComboBoxItem Tag="FFFF0000">
                                <Rectangle Width="22" Height="14" Fill="Red" Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem Tag="FF008000">
                                <Rectangle Width="22" Height="14" Fill="Green" Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem Tag="FF0000FF">
                                <Rectangle Width="22" Height="14" Fill="Blue" Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem Tag="FFFFFF00">
                                <Rectangle Width="22" Height="14" Fill="Yellow" Margin="2,0,0,0" />
                            </ComboBoxItem>
                            <ComboBoxItem Tag="FF000000" IsSelected="True">
                                <Rectangle Width="22" Height="14" Fill="Black" Margin="2,0,0,0" />
                            </ComboBoxItem>
                        </ComboBox>
                    </StackPanel>
                    <!--Fonts Toolbar Section-->
                    

                    
                    
    				
    			</Grid>
                <Grid x:Name="RTBGrid" Grid.Row="1">
                    
                    
                    <RichTextBox x:Name="rtb" AllowDrop="True" Margin="0,0,0,0" MouseRightButtonDown="rtb_MouseRightButtonDown" MouseRightButtonUp="rtb_MouseRightButtonUp" Drop="rtb_Drop" MouseMove="rtb_MouseMove" DragEnter="rtb_DragEnter" DragLeave="rtb_DragLeave" TextWrapping="Wrap" Style="{StaticResource RichTextBoxStyle1}" VerticalScrollBarVisibility="Auto" FontSize="20" ContentChanged="rtb_ContentChanged"/>
                    <Canvas x:Name="highlightCanvas" IsHitTestVisible="False" Margin="0,0,-1,0" />
                	<TextBox x:Name="xamlTb" IsTabStop="False" FontSize="20" FontFamily="Lucida Console" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" Visibility="Collapsed"/>
                    
                </Grid>
            </Grid>
    	</Border>
    </Grid>
</UserControl>
